using System;
using System.Collections.Generic;

namespace Book.Blog.Core.DTOs
{
    public class PageViewDTO
    {
        public required string Path { get; set; }
        public string? Referrer { get; set; }
        public string? UserAgent { get; set; }
        public string? IpAddress { get; set; }
        public Guid? UserId { get; set; }
        public string? SessionId { get; set; }
        public DateTime CreatedTime { get; set; }
    }

    public class UserActionDTO
    {
        public required string ActionType { get; set; }
        public required string EntityType { get; set; }
        public required Guid EntityId { get; set; }
        public string? IpAddress { get; set; }
        public Guid? UserId { get; set; }
        public string? SessionId { get; set; }
        public string? AdditionalData { get; set; }
        public DateTime CreatedTime { get; set; }
    }

    public class DailyStatisticsDTO
    {
        public DateTime Date { get; set; }
        public int PageViews { get; set; }
        public int UniqueVisitors { get; set; }
        public int NewUsers { get; set; }
        public int NewPosts { get; set; }
        public int NewComments { get; set; }
    }

    public class PostStatDTO
    {
        public Guid Id { get; set; }
        public string Title { get; set; } = string.Empty;
        public int ViewCount { get; set; }
        public int CommentCount { get; set; }
        public int LikeCount { get; set; }
        public DateTime CreatedAt { get; set; }
    }

    public class CategoryStatDTO
    {
        public Guid Id { get; set; }
        public string Name { get; set; } = string.Empty;
        public int PostCount { get; set; }
        public int ViewCount { get; set; }
    }

    public class TagStatDTO
    {
        public Guid Id { get; set; }
        public string Name { get; set; } = string.Empty;
        public int PostCount { get; set; }
    }

    public class StatisticsRequestDTO
    {
        public DateTime? StartDate { get; set; }
        public DateTime? EndDate { get; set; }
    }

    public class StatisticsOverviewDTO
    {
        public int TotalPageViews { get; set; }
        public int TotalUsers { get; set; }
        public int TotalPosts { get; set; }
        public int TotalComments { get; set; }
        public IEnumerable<PostStatDTO> TopPosts { get; set; } = new List<PostStatDTO>();
        public IEnumerable<CategoryStatDTO> TopCategories { get; set; } = new List<CategoryStatDTO>();
        public IEnumerable<TagStatDTO> TopTags { get; set; } = new List<TagStatDTO>();
    }
} 